home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_riv_ambrapids3.cog < prev    next >
Text File  |  1999-11-15  |  1KB  |  63 lines

  1. # Jones 3D Cog Script
  2. #
  3. # RIV_AmbRapids3.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message        entered
  13.  
  14.     thing        soundPos0        nolink
  15.     thing        soundPos1        nolink
  16.     
  17.     sector      start_Amb1      linkID=1
  18.     sector      start_Amb2      linkID=1
  19.     
  20.     sector      stop_Amb1       linkID=0
  21.     
  22.     sound        snd_rapids=gen_waterfall_a.wav      local
  23.     
  24.     int         playing=0               local
  25.     int         channel0=0              local
  26.     int         channel1=0              local
  27.     
  28.     flex        min_Pos0=-1
  29.     flex        max_Pos0=-1
  30.     flex        min_Pos1=-1
  31.     flex        max_Pos1=-1
  32.     
  33. end
  34.  
  35. # ========================================================================================
  36.  
  37. code
  38.  
  39. entered:
  40.  
  41.     if((GetSenderID() == 1) && (playing == 0))
  42.     {
  43.         playing = 1;
  44.         
  45.         Sleep(Rand()+0.5);
  46.         channel0 = PlaySoundThing(snd_Rapids, soundPos0, 1.0, min_Pos0, max_Pos0, 0x0001);
  47.         Sleep(Rand()+0.5);
  48.         channel1 = PlaySoundThing(snd_Rapids, soundPos1, 1.0, min_Pos1, max_Pos1, 0x0001);
  49.     }
  50.     
  51.     if(GetSenderID() == 0)
  52.     {
  53.         playing = 0;
  54.         StopSound(channel0, 2.0);
  55.         StopSound(channel1, 2.0);
  56.     }
  57.     
  58.     return;
  59.  
  60. # ========================================================================================
  61.  
  62. end
  63.